<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="UTF-8">
    <title>高校丘比特</title>
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/semantic-ui@2.4.2/dist/semantic.min.css">
    <link rel="stylesheet" th:href="@{/css/3d.css}">
    <link rel="stylesheet" th:href="@{/css/index.css}">
    <link rel="stylesheet">
</head>
<body>
    <img src="/img/indexBackground.jpg" class="index-body"/>
    <div style="position: absolute;z-index: 2;width: 100%">
        <div th:include="common/header"></div>
        <p style="color: coral;font-size: 38px;text-align: center;margin-bottom: 0px">本站功能</p>
        <p style="font-size: 17px;text-align: center">盲盒交友，一切靠缘分,总有人愿意陪你一起奇奇怪怪！</p>
        <div class="ui container" style="width: 78%">
            <div class="ui grid divided center aligned teal" id="three-function-icon" style="margin-top: 40px">
                <div class="five wide column">
                    <a th:if="${session.loginUser!=null}" th:href="@{/wechat/manage(id=${session.loginUser.id})}" style="padding-left: 37px">
                        <i class="ui wechat icon massive" style="color: #04BE02"></i>
                        <div class="icon-name" style="text-align: center">我的微信管理</div>
                    </a>
                    <a th:if="${session.loginUser==null}" th:href="@{/user}" style="padding-left: 37px">
                        <i class="ui wechat icon massive" style="color: #04BE02"></i>
                        <div class="icon-name" style="text-align: center">我的微信管理</div>
                    </a>
                    <div style="margin-top: 20px;text-align: center">
                        <p class="description">查看、修改已投放的微信和已获取的微信</p>
                    </div>
                </div>
                <div class="six wide column">
                    <a th:if="${session.loginUser!=null}" href="#" style="padding-left: 37px" onclick="savaFun()">
                        <i class="paper plane icon massive red" style="padding-left: 20px"></i>
                        <div class="icon-name" style="text-align: center">投放微信</div>
                    </a>
                    <a th:if="${session.loginUser==null}" th:href="@{/user}" style="padding-left: 37px">
                        <i class="paper plane icon massive red" style="padding-left: 20px"></i>
                        <div class="icon-name" style="text-align: center">投放微信</div>
                    </a>
                    <div style="margin-top: 20px;text-align: center">
                        <p class="description">使用此功能您可将自己或朋友的微信投放到本站台，以便他人可以获取到此微信(请确保微信的准确性以保证用户体验)</p>
                    </div>
                </div>
                <div class="five wide column">
                    <a th:if="${session.loginUser!=null}" href="#" style="padding-left: 37px" onclick="takeFun()">
                        <i class="american sign language interpreting icon massive teal"></i>
                        <div class="icon-name" style="text-align: center">我要交朋友</div>
                    </a>
                    <a th:if="${session.loginUser==null}" th:href="@{/user}" style="padding-left: 37px">
                        <i class="american sign language interpreting icon massive teal"></i>
                        <div class="icon-name" style="text-align: center">我要交朋友</div>
                    </a>
                    <div style="margin-top: 20px;text-align: center">
                        <p class="description">该功能可使您随机获取一个已投放到本站的微信号，您可指定性别、学校和年级</p>
                    </div>
                </div>
            </div>
        </div>
        <div class="ui segment basic">
            <div class="cube">
                <div class="box1">
                    <div class="ui label teal" style="width: 100px;height: 100px">广告位招租</div>
                </div>
                <div class="box2">
                    <div class="ui label red" style="width: 100px;height: 100px">广告位招租</div>
                </div>
                <div class="box3">
                    <div class="ui label pink" style="width: 100px;height: 100px">广告位招租</div>
                </div>
                <div class="box4">
                    <div class="ui label orange" style="width: 100px;height: 100px">广告位招租</div>
                </div>
                <div class="box5">
                    <div class="ui label blue" style="width: 100px;height: 100px">广告位招租</div>
                </div>
                <div class="box6">
                    <div class="ui label purple" style="width: 100px;height: 100px">广告位招租</div>
                </div>
            </div>
        </div>
    </div>
<<<<<<< HEAD
    <!--存放微信模态框-->
    <div class="ui modal first">
        <i class="close icon"></i>
        <div class="header">
            投放微信
        </div>
        <form class="ui form" id="saveForm" method="post" action="/pay/saveConfirm">
            <div class="ui segment center aligned">
                <div class="ui segment left aligned " style="margin-left: 30%;width: fit-content">
                    <i class="ui exclamation icon red"></i>
                    <strong>请勿使用虚假微信号！</strong>
                    <br>
                    <br>
                    <i class="ui exclamation icon red"></i>
                    <strong>否则管理员将删除该微信，并对您进行封号警告！</strong>
                </div>
                <div class="ui two column divided grid">
                    <div class="column">
                        <div class="content">
    <!--                        <input th:if="${session.loginUser!=null}" type="hidden" name="userId" th:value="${session.loginUser.id}">-->
                            <div class="inline field rows">
                                <div class="label">微信</div>
                                <div style="padding-left:0px;padding-right:5px;display:inline-block;color: #ccc;text-align: center;font-weight: lighter;">|</div>
                                <input class="text" name="wechat" placeholder="请输入" style="width: 210px" id="wechat" onblur="checkWechat(this)"/>
                            </div>
                            <div class="rows">
                                <div class="label">性别</div>
                                <div style="padding-left:0px;padding-right:5px;display:inline-block;color: #ccc;text-align: center;font-weight: lighter;">|</div>
                                <div class="text">
                                    <select id="sex" name="sex">
                                        <option value="1">男</option>
                                        <option value="0">女</option>
                                    </select>
                                </div>
                            </div>
                            <div class="rows">
                                <div class="label">省份</div>
                                <div style="padding-left:0px;padding-right:5px;display:inline-block;color: #ccc;text-align: center;font-weight: lighter;">|</div>
                                <div class="text"><select id="province" name="province"></select></div>
                            </div>
                            <div class="rows">
                                <div class="label">城市</div>
                                <div style="padding-left:0px;padding-right:5px;display:inline-block;color: #ccc;text-align: center;font-weight: lighter;">|</div>
                                <div class="text"><select id="city" name="city"></select></div>
                            </div>
                            <div class="rows">
                                <div class="label">学校</div>
                                <div style="padding-left:0px;padding-right:5px;display:inline-block;color: #ccc;text-align: center;font-weight: lighter;">|</div>
                                <div class="text"><select id="school" name="school"></select></div>
                            </div>
                            <div class="rows">
                                <div class="label">年级</div>
                                <div style="padding-left:0px;padding-right:5px;display:inline-block;color: #ccc;text-align: center;font-weight: lighter;">|</div>
                                <div class="text">
                                    <select id="grade" name="grade">
                                        <option value="大一">大一</option>
                                        <option value="大二">大二</option>
                                        <option value="大三">大三</option>
                                        <option value="大四">大四</option>
                                        <option value="研一">研一</option>
                                        <option value="研二">研二</option>
                                        <option value="研三">研三</option>
                                        <option value="博士生">博士生</option>
                                        <option value="其他">其他</option>
                                    </select>
                                </div>
=======
</div>
<!--存放微信模态框-->
<div class="ui modal first">
    <i class="close icon"></i>
    <div class="header">
        投放微信
    </div>
    <form class="ui form" id="saveForm" method="get" action="/pay/confirm" th:action="@{/pay/confirm}">
        <div class="ui segment center aligned">
            <div class="ui segment left aligned " style="margin-left: 30%;width: fit-content">
                <i class="ui exclamation icon red"></i>
                <strong>请勿使用虚假微信号！</strong>
                <br>
                <br>
                <i class="ui exclamation icon red"></i>
                <strong>否则管理员将删除该微信，并对您进行封号警告！</strong>
            </div>
            <div class="ui two column divided grid">
                <div class="column">
                    <div class="content">
<!--                        <input th:if="${session.loginUser!=null}" type="hidden" name="userId" th:value="${session.loginUser.id}">-->
                        <div class="inline field rows">
                            <div class="label">微信</div>
                            <div style="padding-left:0px;padding-right:5px;display:inline-block;color: #ccc;text-align: center;font-weight: lighter;">|</div>
                            <input class="text" name="wechat" placeholder="请输入" style="width: 210px" id="wechat"/>
                        </div>
                        <div class="rows">
                            <div class="label">性别</div>
                            <div style="padding-left:0px;padding-right:5px;display:inline-block;color: #ccc;text-align: center;font-weight: lighter;">|</div>
                            <div class="text">
                                <select id="sex" name="sex">
                                    <option value="1">男</option>
                                    <option value="0">女</option>
                                </select>
>>>>>>> 9a66e53171eff92bf88f5bdf58a30715596c289f
                            </div>
                        </div>
                    </div>
                    <div class="column" >
                        <div class="rows">
                            <div class="label">想说的话</div>
                            <div style="padding-left:0px;padding-right:5px;display:inline-block;color: #ccc;text-align: center;font-weight: lighter;">|</div>
                            <div class="text" style="">
                                <textarea rows="4" name="description" id="description" maxlength="40" placeholder="交友宣言：交朋友、吐槽、找考研伙伴、一起上分、一起运动......【不超过80个字符】"></textarea>
                            </div>
                        </div>
                        <div class="rows" style="margin-top: 68px !important;">
                            <div class="label">兴趣爱好</div>
                            <div style="padding-left:0px;padding-right:5px;display:inline-block;color: #ccc;text-align: center;font-weight: lighter;">|</div>
                            <div class="text">
                                <div class="field">
                                    <select multiple="" class="ui dropdown" name="tags" id="tags">
                                        <option th:each="tag,iterStat:${session.tags}" th:value="${tag.id}" th:text="${tag.tagName}"></option>
                                    </select>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </form>
        <div class="actions">
            <div class="ui positive right labeled icon button" onclick="saveBtnFun()">
                投放
                <i class="paper plane outline icon"></i>
            </div>
        </div>
    </div>

    <!--    选择获取模式模态框-->
    <div class="ui coupled modal third small">
<!--        <i class="close icon"></i>-->
        <div class="header">
            模式选择
        </div>
        <div class="ui segment basic">
            <div class="ui two column grid">
                <div class="column">
                    <div class="ui card">
                        <div class='hide'>
                            <h3 style="line-height: 150px;color: white" onclick="randomTake()" class="randomTakeBtn">
                                随机选择
                            </h3>
                        </div>
                        <div class="content">
                            <div class="ui list">
                                <div class="item">
                                    <i class="tag teal icon"></i>
                                    <div class="content">
                                        指定性别
                                    </div>
                                </div>
                                <div class="item">
                                    <i class="tag teal icon"></i>
                                    <div class="content">
                                        随机获取一个
                                    </div>
                                </div>
                                <div class="item">
                                    <i class="tag red icon"></i>
                                    <div class="content">
                                        兴趣、爱好随机
                                    </div>
                                </div>
                                <div class="item">
                                    <i class="tag red icon"></i>
                                    <div class="content">
                                        学校、年级随机
                                    </div>
                                </div>
                                <div class="item">
                                    <i class="yen sign yellow icon"></i>
                                    <div class="content">
                                        <strong>0.2元/次</strong>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="column">
                    <div class="ui card">
                        <div class='hide'>
                            <h3 style="line-height: 150px;color: red" onclick="singleTake()" class="signalTakeBtn">
                                指定选择
                            </h3>
                        </div>
                        <div class="content">
                            <div class="ui list">
                                <div class="item">
                                    <i class="tag teal icon"></i>
                                    <div class="content">
                                        指定性别
                                    </div>
                                </div>
                                <div class="item">
                                    <i class="tag teal icon"></i>
                                    <div class="content">
                                        指定学校、年级
                                    </div>
                                </div>
                                <div class="item">
                                    <i class="tag teal icon"></i>
                                    <div class="content">
                                        选择兴趣爱好
                                    </div>
                                </div>
                                <div class="item">
                                    <i class="tag teal icon"></i>
                                    <div class="content">
                                        系统随机抽取5位，用户从中选取1位
                                    </div>
                                </div>
                                <div class="item">
                                    <i class="yen sign yellow icon"></i>
                                    <div class="content">
                                        <strong>0.5元/次</strong>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <div class="actions">
            <div class="ui black deny button">
                取消
            </div>
        </div>
    </div>
<<<<<<< HEAD
    <!--指定获取微信模态框-->
    <div class="ui coupled modal fourth">
        <i class="close icon"></i>
        <div class="header">
            指定获取
        </div>
        <form class="ui form" id="singleTake" method="post" action="/pay/signalTakeConfirm">
            <div class="ui segment center aligned">
                <div class="ui segment left aligned " style="margin-left: 30%;width: fit-content">
                    <i class="ui exclamation icon red"></i>
                    <strong>请勿将获得的微信作用于不正当的途径(微信号如有问题，请点击右上角联系站主处理)</strong>
                    <br>
                    <br>
                    <i class="ui exclamation icon red"></i>
                    <strong>否则管理员将删除该微信，并对您进行封号警告！</strong>
                </div>
<!--                <div class="ui two column divided grid">-->
<!--                    <div class="column">-->
                        <div class="content">
                                <div class="rows">
                                    <div class="label">性别</div>
                                    <div style="padding-left:0px;padding-right:5px;display:inline-block;color: #ccc;text-align: center;font-weight: lighter;">|</div>
                                    <div class="text">
                                        <select id="takeSex" name="sex">
                                            <option value="1">男</option>
                                            <option value="0">女</option>
                                        </select>
                                    </div>
                                </div>
                                <div class="rows">
                                    <div class="label">省份</div>
                                    <div style="padding-left:0px;padding-right:5px;display:inline-block;color: #ccc;text-align: center;font-weight: lighter;">|</div>
                                    <div class="text"><select id="takeProvince" name="province"></select></div>
                                </div>
                                <div class="rows">
                                    <div class="label">城市</div>
                                    <div style="padding-left:0px;padding-right:5px;display:inline-block;color: #ccc;text-align: center;font-weight: lighter;">|</div>
                                    <div class="text"><select id="takeCity" name="city"></select></div>
                                </div>
                                <div class="rows">
                                    <div class="label">学校</div>
                                    <div style="padding-left:0px;padding-right:5px;display:inline-block;color: #ccc;text-align: center;font-weight: lighter;">|</div>
                                    <div class="text"><select id="takeSchool" name="school"></select></div>
                                </div>
                                <div class="rows">
                                    <div class="label">年级</div>
                                    <div style="padding-left:0px;padding-right:5px;display:inline-block;color: #ccc;text-align: center;font-weight: lighter;">|</div>
                                    <div class="text">
                                        <select id="takeGrade" name="grade">
                                            <option value="大一">大一</option>
                                            <option value="大二">大二</option>
                                            <option value="大三">大三</option>
                                            <option value="大四">大四</option>
                                            <option value="研一">研一</option>
                                            <option value="研二">研二</option>
                                            <option value="研三">研三</option>
                                            <option value="博士生">博士生</option>
                                            <option value="其他">其他</option>
                                        </select>
                                    </div>
                                </div>
                        </div>
<!--                    </div>-->
<!--                </div>-->
=======
</div>
<!--获取微信模板-->
<div class="ui modal second">
    <i class="close icon"></i>
    <div class="header">
        获取微信
    </div>
    <form class="ui form" id="takeForm" method="post" action="/pay/takeconfirm" th:action="@{/pay/takeconfirm}">
        <div class="ui segment center aligned">
            <div class="ui segment left aligned " style="margin-left: 30%;width: fit-content">
                <i class="ui exclamation icon red"></i>
                <strong>请勿将获得的微信作用于不正当的途径</strong>
                <br>
                <br>
                <i class="ui exclamation icon red"></i>
                <strong>否则管理员将删除该微信，并对您进行封号警告！</strong>
>>>>>>> 9a66e53171eff92bf88f5bdf58a30715596c289f
            </div>
        </form>
        <div class="actions">
            <div class="ui positive right labeled icon button" onclick="signalTakeBtnFun()">
                获取
                <i class="paper plane outline icon"></i>
            </div>
        </div>
    </div>
    <!--随机获取微信模态框-->
    <div class="ui coupled modal second">
        <i class="close icon"></i>
        <div class="header">
            随机获取
        </div>
        <form class="ui form" id="randomTake" method="post" action="/pay/randomTakeConfirm">
            <div class="ui segment center aligned">
                <div class="ui segment left aligned " style="margin-left: 30%;width: fit-content">
                    <i class="ui exclamation icon red"></i>
                    <strong>请勿将获得的微信作用于不正当的途径(微信号如有问题，请点击右上角联系站主处理)</strong>
                    <br>
                    <br>
                    <i class="ui exclamation icon red"></i>
                    <strong>否则管理员将删除该微信，并对您进行封号警告！</strong>
                </div>
                <div class="ui two column divided grid">
                    <div class="column">
                        <div class="content">
                            <div class="rows">
                                <div class="label">性别</div>
                                <div style="padding-left:0px;padding-right:5px;display:inline-block;color: #ccc;text-align: center;font-weight: lighter;">|</div>
                                <div class="text">
                                    <select id="sex1" name="sex">
                                        <option value="1">男</option>
                                        <option value="0">女</option>
                                    </select>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="column" >
                        <div class="rows">
                            <div class="ui label" style="color:red">注意！</div>
                            <div style="padding-left:0px;padding-right:5px;display:inline-block;color: #ccc;text-align: center;font-weight: lighter;">|</div>
                            <div class="text">
                                <text name="description" maxlength="40">在您获取微信后，请确保对方学生身份，如有疑问请联系站主处理(站主人很好哦，也是学生很好说话的)</text>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </form>
        <div class="actions">
            <div class="ui positive right labeled icon button" onclick="takeBtnFun()">
                获取
                <i class="paper plane outline icon"></i>
            </div>
        </div>
    </div>




<script src="https://cdn.jsdelivr.net/npm/jquery@3.2/dist/jquery.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/semantic-ui@2.4.2/dist/semantic.min.js"></script>
<script th:src="@{/js/AllSchool.js}"></script>
<script>
    function checkWechat(param) {
        let wechat = param.value;
        $.ajax({
            url:"/wechat/checkWechat",
            type:"GET",
            data:{"wechat":wechat},
            success:function (result) {
                if(result){
                    alert("【"+wechat+"】该微信已被投放！");
                    param.value="";
                }
            }
        })
    }
    function savaFun(){
        $(".form").form('clear')
        $(".first")
            .modal("show")
            .modal('setting','closable',false)
    }
    //我要交朋友按钮
    function takeFun(){
        // $(".second")
        //     .modal("show")
        //     .modal('setting','closable',false)
        $(".third")
            .modal("show")
            .modal('setting','closable',false)
    }
    //随机选择
    function randomTake() {
        // initialize all modals
        $('.coupled.modal')
            .modal({
                allowMultiple: false
            })
        ;
        // open second modal on first modal buttons
        $('.second.modal')
            .modal("show");
    }
    //指定选择
    function singleTake() {
        $(".form").form('clear')
        // initialize all modals
        $('.coupled.modal')
            .modal({
                allowMultiple: false
            })
        ;
// open second modal on first modal buttons
        $('.fourth.modal')
            .modal("show");
    }

    //随机获取按钮
    function takeBtnFun(){
        let sex = $("#sex1").val();
        if (sex !== null) {
            $.ajax({
                url: "/wechat/randomCheck",
                type: "GET",
                data: {"sex":sex},
                success: function (result) {
                    if(!result){
                        alert("抱歉，库存不足，请稍后再来！")
                        $(".form").clear()
                    }else{
                        $(".form").submit();
                    }
                }
            })
        } else {
            alert("请选择性别！");
        }
    }
    //指定获取按钮
    function signalTakeBtnFun() {
        let sex = $("#takeSex").val();
        let province = $("#takeProvince").val();
        let city = $("#takeCity").val();
        let school = $("#takeSchool").val();
        let grade = $("#takeGrade").val();
        if(sex!=null&&province!=null&&city!=null&&school!=null&&grade!=null){
            $.ajax({
                url: "/wechat/signalCheck",
                type: "GET",
                data: {"sex":sex,"province":province,"city":city,"school":school,"grade":grade},
                success:function (result) {
                    if(result===0){
                        alert("抱歉，库存不足，请稍后再来！");
                    }else if(result<3){
                        let b = confirm("注意：符合要求的微信只有【"+result+"】个,是否继续？");
                        if(b){
                            $("#singleTake").submit()
                        }
                    }else{
                        $("#singleTake").submit()
                    }
                }
            })
        }else{
            alert("请完善表单！");
        }
    }
    //投放按钮
    function saveBtnFun() {
        let wechat = $("#wechat").val();
        let sex = $("#sex").val();
        let province = $("#province").val();
        let city = $("#city").val();
        let school = $("#school").val();
        let grade = $("#grade").val();
        let description = $("#description").val();
        let tags = $("#tags").val();
        if (wechat !== "" && sex !== null && province !== null && city !== null && school !== null && grade !== null && description !== "" && tags.length!==0) {
            $(".form").submit();
        } else {
            alert("请完善信息！");
        }
    }
    //下拉框
    $('.ui.dropdown').dropdown();
</script>
<script>
    // <!--高校下拉列表(投放)-->
    $(function () {
        var provinceArray = "";
        var provicneSelectStr = "";
        for(var i=0,len=province.length;i<len;i++){
            provinceArray = province[i];
            provicneSelectStr = provicneSelectStr + "<option value='"+provinceArray[0]+"'>"+provinceArray[1]+"</option>"
        }
        $("#province").html(provicneSelectStr);

        var selectCity = $("#province").val();
        var citylist=city[selectCity];
        var cityArray = "";
        var citySelectStr = "";
        for(var i=0,len=citylist.length;i<len;i++){
            cityArray = citylist[i];
            citySelectStr = citySelectStr + "<option value='"+cityArray[0]+"'>"+cityArray[1]+"</option>"
        }
        $("#city").html(citySelectStr);

        var selectschool = $("#city").val();
        var schoolUlStr = "";
        var schoolListStr = allschool[selectschool];
        for(var i=0,len=schoolListStr.length;i<len;i++){
            schoolUlStr = schoolUlStr + "<option >"+schoolListStr[i][2]+"</option>";
        }
        schoolUlStr = schoolUlStr + "<option value='999'>其它</option>";
        $("#school").html(schoolUlStr);
        //省切换事件
        $("#province").change(function(){
            var selectCity = $("#province").val();
            var citylist=city[selectCity];
            var cityArray = "";
            var citySelectStr = "";
            if(citylist!=null){
                for(var i=0,len=citylist.length;i<len;i++){
                    cityArray = citylist[i];
                    citySelectStr = citySelectStr + "<option value='"+cityArray[0]+"'>"+cityArray[1]+"</option>"
                }
            }

            $("#city").html(citySelectStr);
            // $("#school1").show();
            // $("#school2").hide();
            var selectschool = $("#city").val();
            var schoolUlStr = "";
            var schoolListStr = allschool[selectschool];
            for(var i=0,len=schoolListStr.length;i<len;i++){
                schoolUlStr = schoolUlStr + "<option >"+schoolListStr[i][2]+"</option>";
            }
            schoolUlStr = schoolUlStr + "<option value='999'>其它</option>";
            $("#school").html(schoolUlStr);
        });
        //切换城市事件
        $("#city").change(function(){
            // $("#school1").show();
            // $("#school2").hide();
            var selectschool = $("#city").val();
            var schoolUlStr = "";
            var schoolListStr = allschool[selectschool];
            for(var i=0,len=schoolListStr.length;i<len;i++){
                schoolUlStr = schoolUlStr + "<option >"+schoolListStr[i][2]+"</option>";
            }
            schoolUlStr = schoolUlStr + "<option value='999'>其它</option>";
            $("#school").html(schoolUlStr);
        });
        $("#school").change(function(){
            if($("#school").val()=="999"){
                // $("#school1").hide();
                // $("#school2").show();
            }
        });
        // $("#second").show();
        // $("#restart").css("backgorund","url('assets/images/chongxintijiao.jpg') no-repeat");

        // <!--高校下拉列表(获取)-->
        var provinceArray = "";
        var provicneSelectStr = "";
        for(var i=0,len=province.length;i<len;i++){
            provinceArray = province[i];
            provicneSelectStr = provicneSelectStr + "<option value='"+provinceArray[0]+"'>"+provinceArray[1]+"</option>"
        }
        $("#takeProvince").html(provicneSelectStr);

        var selectCity = $("#takeProvince").val();
        var citylist=city[selectCity];
        var cityArray = "";
        var citySelectStr = "";
        for(var i=0,len=citylist.length;i<len;i++){
            cityArray = citylist[i];
            citySelectStr = citySelectStr + "<option value='"+cityArray[0]+"'>"+cityArray[1]+"</option>"
        }
        $("#takeCity").html(citySelectStr);

        var selectschool = $("#takeCity").val();
        var schoolUlStr = "";
        var schoolListStr = allschool[selectschool];
        for(var i=0,len=schoolListStr.length;i<len;i++){
            schoolUlStr = schoolUlStr + "<option >"+schoolListStr[i][2]+"</option>";
        }
        schoolUlStr = schoolUlStr + "<option value='999'>其它</option>";
        $("#takeSchool").html(schoolUlStr);
        //省切换事件
        $("#takeProvince").change(function(){
            var selectCity = $("#takeProvince").val();
            var citylist=city[selectCity];
            var cityArray = "";
            var citySelectStr = "";
            if(citylist!=null){
                for(var i=0,len=citylist.length;i<len;i++){
                    cityArray = citylist[i];
                    citySelectStr = citySelectStr + "<option value='"+cityArray[0]+"'>"+cityArray[1]+"</option>"
                }
            }

            $("#takeCity").html(citySelectStr);
            // $("#school1").show();
            // $("#school2").hide();
            var selectschool = $("#takeCity").val();
            var schoolUlStr = "";
            var schoolListStr = allschool[selectschool];
            for(var i=0,len=schoolListStr.length;i<len;i++){
                schoolUlStr = schoolUlStr + "<option >"+schoolListStr[i][2]+"</option>";
            }
            schoolUlStr = schoolUlStr + "<option value='999'>其它</option>";
            $("#takeSchool").html(schoolUlStr);
        });
        //切换城市事件
        $("#takeCity").change(function(){
            // $("#school1").show();
            // $("#school2").hide();
            var selectschool = $("#takeCity").val();
            var schoolUlStr = "";
            var schoolListStr = allschool[selectschool];
            for(var i=0,len=schoolListStr.length;i<len;i++){
                schoolUlStr = schoolUlStr + "<option >"+schoolListStr[i][2]+"</option>";
            }
            schoolUlStr = schoolUlStr + "<option value='999'>其它</option>";
            $("#takeSchool").html(schoolUlStr);
        });
        $("#takeSchool").change(function(){
            if($("#takeSchool").val()=="999"){
                // $("#school1").hide();
                // $("#school2").show();
            }
        });
        // $("#second").show();
        // $("#restart").css("backgorund","url('assets/images/chongxintijiao.jpg') no-repeat");
    })
</script>
</body>
</html>
